<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <head th:replace="common/head"/>
</head>
<body>
<div class="x-body">
    <form class="layui-form" style="padding-bottom: 10px;text-align: left;">
        <div class="layui-form-item">
            客户：
            <div class="layui-inline">
                <select name="userId" lay-search="">
                    <option value="">直接选择或搜索选择</option>
                    <th:block th:each="map: ${customerList}">
                        <option th:value="${map.userId}" th:text="${map.userName}"></option>
                    </th:block>
                </select>
            </div>
            商品：
            <div class="layui-inline">
                <select name="goodsId" lay-search="">
                    <option value="">直接选择或搜索选择</option>
                    <th:block th:each="map: ${goodsList}">
                        <option th:value="${map.goodsId}" th:text="${map.goodsCode+'/'+map.goodsName}"></option>
                    </th:block>
                </select>
            </div>
            订单时间起：
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" name="beginDate" lay-verify="myCheckDate" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input layDate">
                </div>
            </div>
            止：
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" name="endDate" lay-verify="myCheckDate" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input layDate">
                </div>
            </div>
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
        </div>
    </form>

    <table class="layui-table"
           lay-data="{url:'/statistics/getUserGoods', page:true,id:'table',limit:15,limits:[10,15,20,50,100]}"
           lay-filter="table">
        <thead>
        <tr>
            <th lay-data="{field:'userName',sort: true,align:'center'}">客户</th>
            <th lay-data="{field:'goodsCode',sort: true,align:'center'}">商品编码</th>
            <th lay-data="{field:'goodsName',sort: true,align:'center'}">商品名称</th>
            <th lay-data="{field:'goodsCount',sort: true,align:'center'}">销售数量</th>
            <th lay-data="{field:'goodsTotalSale',sort: true,align:'center'}">总销售额</th>
            <th lay-data="{field:'goodsTotalOriginal',sort: true,align:'center'}">总成本</th>
            <th lay-data="{field:'goodsTotalEarn',sort: true,align:'center'}">总利润</th>
        </tr>
        </thead>
    </table>

</div>
<div th:replace="common/js"></div>
<div th:replace="common/setting"></div>
<script type="text/javascript">
    layui.use('xstatistics');
    layui.use('xtable');
</script>
</body>
</html>
